package infb.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "PARTES_MEDICOS")
@NamedQueries({@NamedQuery(name = "PartesMedicos.findAll", query = "SELECT p FROM PartesMedicos p"), @NamedQuery(name = "PartesMedicos.findById", query = "SELECT p FROM PartesMedicos p WHERE p.id = :id"), @NamedQuery(name = "PartesMedicos.findByFechaTramitacion", query = "SELECT p FROM PartesMedicos p WHERE p.fechaTramitacion = :fechaTramitacion"), @NamedQuery(name = "PartesMedicos.findBySintomas", query = "SELECT p FROM PartesMedicos p WHERE p.sintomas = :sintomas"), @NamedQuery(name = "PartesMedicos.findByDiagnostico", query = "SELECT p FROM PartesMedicos p WHERE p.diagnostico = :diagnostico"), @NamedQuery(name = "PartesMedicos.findByTratamiento", query = "SELECT p FROM PartesMedicos p WHERE p.tratamiento = :tratamiento"), @NamedQuery(name = "PartesMedicos.findByPrivado", query = "SELECT p FROM PartesMedicos p WHERE p.privado = :privado"), @NamedQuery(name = "PartesMedicos.findByPaciente", query = "SELECT p FROM PartesMedicos p WHERE p.paciente = :paciente")})
@SequenceGenerator(name="secuencia_partes_medicos",sequenceName="SECUENCIA_PARTES_MEDICOS",allocationSize=1)
public class PartesMedicos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="secuencia_partes_medicos")
    private Long id;
    @Column(name = "FECHA_TRAMITACION")
    @Temporal(TemporalType.DATE)
    private Date fechaTramitacion;
    @Column(name = "FECHA_FINALIZACION")
    @Temporal(TemporalType.DATE)
    private Date fechaFinalizacion;
    @Column(name = "SINTOMAS")
    private String sintomas;
    @Column(name = "DIAGNOSTICO")
    private String diagnostico;
    @Column(name = "TRATAMIENTO")
    private String tratamiento;
    @Column(name = "PRIVADO")
    private Short privado;
    @Basic(optional = false)
    @Column(name = "PACIENTE")
    private String paciente;
    @JoinColumn(name = "MEDICO", referencedColumnName = "DNI")
    @ManyToOne(optional = false)
    private Medicos medico;

    public PartesMedicos() {
    }

    public PartesMedicos(Long id) {
        this.id = id;
    }

    public PartesMedicos(Long id, String paciente) {
        this.id = id;
        this.paciente = paciente;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getFechaTramitacion() {
        return fechaTramitacion;
    }

    public void setFechaTramitacion(Date fechaTramitacion) {
        this.fechaTramitacion = fechaTramitacion;
    }

    public Date getFechaFinalizacion() {
        return fechaFinalizacion;
    }

    public void setFechaFinalizacion(Date fechaFinalizacion) {
        this.fechaFinalizacion = fechaFinalizacion;
    }

    public String getSintomas() {
        return sintomas;
    }

    public void setSintomas(String sintomas) {
        this.sintomas = sintomas;
    }

    public String getDiagnostico() {
        return diagnostico;
    }

    public void setDiagnostico(String diagnostico) {
        this.diagnostico = diagnostico;
    }

    public String getTratamiento() {
        return tratamiento;
    }

    public void setTratamiento(String tratamiento) {
        this.tratamiento = tratamiento;
    }

    public Short getPrivado() {
        return privado;
    }

    public void setPrivado(Short privado) {
        this.privado = privado;
    }

    public String getPaciente() {
        return paciente;
    }

    public void setPaciente(String paciente) {
        this.paciente = paciente;
    }

    public Medicos getMedico() {
        return medico;
    }

    public void setMedico(Medicos medico) {
        this.medico = medico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PartesMedicos)) {
            return false;
        }
        PartesMedicos other = (PartesMedicos) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "infb.modelo.PartesMedicos[id=" + id + "]";
    }

}
